import {
    AmbientLight,
    PointLight,
    SpotLight
} from 'three'
import { wall } from './mesh'


//创建环境光
const ambientLight: AmbientLight = new AmbientLight('rgb(255,255,255)', 0.7)
//色度0-255  ->  0-1

// 0, 1,  1
// console.log('ambientLight',  ambientLight.color


//创建点光源
export const pointLight: PointLight = new PointLight('rgb(255,0,0)', 0.5, 25, 0.1)
pointLight.position.set(20, 20, 20)

//创建聚光灯
export const spotLight: SpotLight = new SpotLight('rgb(255,255,255)', 1, 400, Math.PI/9, )
spotLight.position.set(0, 150, 245);
//开启投影
spotLight.castShadow = true
//聚光灯默认指向(0,0,0), 需要设置带有position属性的对象作为target
//因此设置rotation无效
// spotLight.rotation.x = 1000

spotLight.target = wall;

export const lightArr = [
    ambientLight,
    // pointLight,
    spotLight
]